Statistics and Data Visualization Using R by David S. Brown

Statistics and Data Visualization Using R by David S. Brown

Author:David S. Brown
Language: eng
Format: epub, pdf
Published: 2021-09-02T04:52:18.431608+00:00


Now that we have all of the data, we simply draw a figure with ggplot that has two geom_line() functions included, one colored red (normal distribution) and one colored blue (t-distribution) (Figure 9-1). To note, I added labels to this figure in Adobe Illustrator.

Code Chunk 9-5

ggplot(mydata, aes(x1)) +

  geom_line(aes(y = x2), col=”#0000bf”) +

  geom_line(aes(y = x3), col=”#bf0000”) +

  theme_minimal() +

  theme(plot.title = element_text(size = 8, face = “bold”),

       axis.title = element_text(size = 8, face = “bold”)) +

  xlab(“Standard Deviations”) +

  ylab(“Density”) +

  ggtitle(“Figure 9-1: The t-Distribution Has Fatter Tails”)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.